public enum ServiceTypeEnum {
    ALERT_LIB(-2, "布控库"),
    STATIC_LIB(-1, "静态库"),
    IMAGE_ACCESS(0, "图片异步接入"),
    FACE(1, "人脸"),
    STRUCT(2, "结构化"),
    SCENARIO_CITY_MANAGEMENT(3, "城管类"),
    CROWD(4, "人群"),
    FACE_PEDESTRIAN(5, "人脸人体联合"),
    MULTI_FACE_PACH(6, "人脸+结构化");

    private int code;

    private String desc;

    private int scenarioType;

    ServiceTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getScenarioType() {
        return scenarioType;
    }

    public void setScenarioType(int scenarioType) {
        this.scenarioType = scenarioType;
    }

    public static ServiceTypeEnum getByCode(int code) {
        for (ServiceTypeEnum e : ServiceTypeEnum.values()) {
            if (e.code == code) {
                return e;
            }
        }
        return null;
    }
}
